package com.chen.common.config;

import com.netflix.loadbalancer.AvailabilityFilteringRule;
import com.netflix.loadbalancer.IRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName
 * @Description: 自定义负载均衡算法
 * @Author:
 * @Date: Created in 17:34 2022/6/5
 */
@Configuration
public class MyRule {

    @Bean
    public IRule definitionRule(){
//        return new MyRandomRule();  //默认是轮循，现在自定义算法规则
        return new AvailabilityFilteringRule(); //
    }

}
